<?php        
    class WorkoutModel extends Model {
        public static $classDesc = "Workout";
        
        public static $keyDesc = array(
            "id"                    => "ID",
            "hashid"                => "Hashid",
            "userid"                => "User ID",
            "locationid"            => "Location ID",
            "training_programid"    => "Training program ID",
            "user_weightid"         => "User weight ID",
            "extratext"             => "Name/desc",
            "starttime"             => "Start time",
            "endtime"               => "End time",
            "updated"               => "Updated",
            "rowstamp"              => "Created"
        );
        
        public function __construct($id = null) {
            $this->_childClass["workout_exercise"] = "WorkoutExerciseModel";
            $this->_childClass["workout_record"]   = "WorkoutRecordModel";
            
            $this->_childs["workout_exercise"] = null;
            $this->_childs["workout_record"]   = null;
            
            $this->_foreignIdCol    = "workoutid";
            $this->_table           = "workout";                        
            
            parent::__construct($id);
            
            # Tekstikenttien minimipituus
            parent::$_schema["workout"]["extratext"]["minlength"] = 1;
        }
    }